package ooday03;

public class Polo {
//    public static void main(String[] args) {
//        Animal animal=new Dog();
//        Dog d=(Dog)animal;
//        inter i=(inter)animal;
//        //Fish f=(Fish)animal;
//        if(animal instanceof Dog)
//        {
//            System.out.println(d);
//        }
//        if(animal instanceof Fish)
//        {
//            System.out.println(f);
//        }

//        Animal[] animals = new Animal[5];
//        animals[0] = new Dog("hei","black",3);
//        animals[1] = new Dog("hei","red",2);
//        animals[2] = new Chick("ji","yellow",1);
//        animals[3] = new Chick("ji","yellow",2);
//        animals[4] = new Fish("yu","red",1);
//        for(int i=0; i<animals.length; i++) {
//            System.out.println(animals[i].name + " " + animals[i].color + " " + animals[i].age);
//            if(animals[i] instanceof Dog) {
//                Dog d = (Dog)animals[i];
//                d.lookHome();
//            }
//            if(animals[i] instanceof Chick) {
//                Chick c = (Chick)animals[i];
//                c.layegg();
//            }
//            if(animals[i] instanceof inter) {
//                inter s = (inter)animals[i];
//                s.swim();
//            }
//        }


//        Dog d = new Dog("hei","black",2);
//        Fish f=new Fish("yu","black",2);
//        Chick ch=new Chick("ji","yellow",1);
//        Master master=new Master();
//        master.feed(d);
//        master.feed(f);
//        master.feed(ch);
    }
//}
